<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>
<script type="text/javascript">
	function onsubmitform(){
		var password = $("#user_password").val();
		var confirm = $("#user_confirm").val();
		
		if(password != confirm){
			alert("password not match");
			return false;
		}else{
			return true;
		}

	}
</script>
<form
	action="<?php echo url_for('login/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() : '')) ?>"
	method="post"
	<?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>
	onsubmit="return onsubmitform()">
	<?php if (!$form->getObject()->isNew()): ?>
	<input type="hidden" name="sf_method" value="put" />
	<?php endif; ?>
	<table>
		<tfoot>
			<tr>
				<td colspan="2"><?php echo $form->renderHiddenFields(false) ?>
					&nbsp;<a href="<?php echo url_for('login/index') ?>">戻る</a>
					<?php if (!$form->getObject()->isNew()): ?> &nbsp;<?php echo link_to('Delete', 'login/delete?id='.$form->getObject()->getId(), array('method' => 'delete', 'confirm' => 'Are you sure?')) ?>
					<?php endif; ?> <input type="submit" value="保存" />
				</td>
			</tr>
		</tfoot>
		<tbody>
		<?php echo $form->renderGlobalErrors() ?>
			<tr>
				<th><?php echo $form['loginId']->renderLabel() ?></th>
				<td><?php echo $form['loginId']->renderError() ?> <?php echo $form['loginId'] ?>
				</td>
			</tr>
			<tr>
				<th><?php echo $form['name']->renderLabel() ?></th>
				<td><?php echo $form['name']->renderError() ?> <?php echo $form['name'] ?>
				</td>
			</tr>
			<tr>
				<th><?php echo $form['email']->renderLabel() ?></th>
				<td><?php echo $form['email']->renderError() ?> <?php echo $form['email'] ?>
				</td>
			</tr>
			<tr>
				<th><?php echo $form['password']->renderLabel() ?></th>
				<td><?php echo $form['password']->renderError() ?> <?php echo $form['password'] ?>
				</td>
			</tr>
			<tr>
				<th><label for="user_confirm">パースワード確認</label></th>
				<td>
					<ul class="error_list">
						
					</ul> <input id="user_confirm" name="user_confirm" type="password"></input>
				</td>
			</tr>
		</tbody>
	</table>
</form>
